package org.dxy.domain.event.workorder;

import org.dxy.domain.event.AggregateTypeEnum;
import org.dxy.domain.event.DomainEvent;

/**
 * 工单已指定工艺路线事件
 * @author dxy
 * @createTime 2025/9/16 23:39
 */
public record RouteAssignedToOrderEvent(
    /** 工单ID */
    Long workOrderId,
    /** 工单编码 */
    String workOrderCode,
    /** 工艺路线ID */
    Long routeId
) implements DomainEvent {
    
    @Override
    public Long aggregateId() {
        return workOrderId;
    }

    @Override
    public String aggregateType() {
        return AggregateTypeEnum.WORK_ORDER.getKey();
    }

    @Override
    public String eventType() {
        return WorkOrderEventTypeEnum.ROUTE_ASSIGNED.getKey();
    }

    /**
     * 获取工单事件类型枚举
     */
    public WorkOrderEventTypeEnum getWorkOrderEventType() {
        return WorkOrderEventTypeEnum.ROUTE_ASSIGNED;
    }
}